{
  "properties" : { },
  "id" : "copy1736411229281d68570",
  "script" : null,
  "groupId" : "8a4d09d5d4824ed99d9cf45868c29fe1",
  "name" : "用户_单位",
  "createTime" : null,
  "updateTime" : 1736603335199,
  "lock" : null,
  "createBy" : "管理员",
  "updateBy" : "可辉",
  "path" : "user/role",
  "method" : "GET",
  "parameters" : [ ],
  "options" : [ {
    "name" : "permission",
    "value" : "system:jggl",
    "description" : "允许拥有该权限的访问",
    "required" : false,
    "dataType" : "String",
    "type" : null,
    "defaultValue" : null,
    "validateType" : null,
    "error" : null,
    "expression" : null,
    "children" : null
  } ],
  "requestBody" : "",
  "headers" : [ ],
  "paths" : [ ],
  "responseBody" : "{\n    \"code\": 200,\n    \"msg\": \"success\",\n    \"data\": [\n        {\n            \"name\": \"管理员\",\n            \"userId\": 1001,\n            \"memo\": \"ps: 管理系统的人员\"\n        },\n        {\n            \"name\": \"游客\",\n            \"userId\": 1002,\n            \"memo\": \"ps: 公开对外用户。\"\n        },\n        {\n            \"name\": \"可辉\",\n            \"userId\": 1003,\n            \"memo\": \"ps: \"\n        }\n    ]\n}",
  "description" : null,
  "requestBodyDefinition" : null,
  "responseBodyDefinition" : null
}
================================
import org.springframework.util.ObjectUtils
import com.gitee.fastmybatis.core.query.Query;
import 'com.wiwf.model.mapper.admin.dao.SysUserMapper' as sysUserMapper;

var sqlOrXml = """
SELECT
	su.`name`, 
	su.user_id, 
	su.memo, 
	suur.unit_id, 
	suur.role_id
FROM
	sys_user AS su
	LEFT JOIN
	sys_unit_user_role AS suur
	ON 
		su.user_id = suur.user_id
"""

return db.admin.select(sqlOrXml);